/*    */ package cc.s2m.web.s2mBlog.controller.admin;
/*    */ 
/*    */ import cc.s2m.util.BeanConverter;
/*    */ import cc.s2m.util.Page;
/*    */ import cc.s2m.web.s2mBlog.controller.base.BaseController;
/*    */ import cc.s2m.web.s2mBlog.pojo.ArticlesTags;
/*    */ import cc.s2m.web.s2mBlog.service.IArticlesTags;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.ui.Model;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ import org.springframework.web.bind.annotation.ResponseBody;
/*    */ 
/*    */ @Controller("admin_ArticlesTagsController")
/*    */ @RequestMapping({"/admin/articlesTags"})
/*    */ public class ArticlesTagsController extends BaseController
/*    */ {
/*    */ 
/*    */   @Autowired
/*    */   private IArticlesTags articlesTagsService;
/*    */ 
/*    */   @RequestMapping({"/list"})
/*    */   public String list(Model model, ArticlesTags bean, Integer page)
/*    */   {
/* 25 */     if (page == null) page = Integer.valueOf(1);
/* 26 */     Map map = new HashMap();
/* 27 */     if (bean != null) {
/* 28 */       map.putAll(BeanConverter.toMap(bean, false));
/* 29 */       model.addAttribute("bean", bean);
/*    */     }
/* 31 */     Page pageBean = this.articlesTagsService.getPage(page.intValue(), 50, null, map);
/* 32 */     model.addAttribute("pageBean", pageBean);
/* 33 */     return "admin/articlesTags";
/*    */   }
/*    */ 
/*    */   @RequestMapping(value={"/add"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public String add(Model model, Integer id) {
/* 38 */     if (id != null) {
/* 39 */       ArticlesTags bean = (ArticlesTags)this.articlesTagsService.selectByPrimaryKey(id);
/* 40 */       model.addAttribute("bean", bean);
/*    */     }
/* 42 */     return "admin/articlesTags_add";
/*    */   }
/*    */ 
/*    */   @RequestMapping(value={"/view"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public String view(Model model, Integer id) {
/* 47 */     if (id != null) {
/* 48 */       ArticlesTags bean = (ArticlesTags)this.articlesTagsService.selectByPrimaryKey(id);
/* 49 */       model.addAttribute("bean", bean);
/*    */     }
/* 51 */     return "admin/articlesTags_view";
/*    */   }
/*    */   @RequestMapping(value={"/save"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*    */   @ResponseBody
/*    */   public String save(Model model, ArticlesTags bean) {
/* 57 */     if (bean == null) {
/* 58 */       return "empty";
/*    */     }
/* 60 */     if (bean.getId() == null)
/*    */     {
/* 62 */       this.articlesTagsService.insertSelective(bean);
/*    */     }
/*    */     else {
/* 65 */       this.articlesTagsService.updateByPrimaryKeySelective(bean);
/*    */     }
/* 67 */     return "success";
/*    */   }
/*    */   @RequestMapping(value={"/del"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*    */   @ResponseBody
/*    */   public String del(Integer id) {
/* 73 */     ArticlesTags bean = (ArticlesTags)this.articlesTagsService.selectByPrimaryKey(id);
/* 74 */     if (bean != null) {
/* 75 */       this.articlesTagsService.deleteByPrimaryKey(id);
/*    */     }
/* 77 */     return "success";
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.controller.admin.ArticlesTagsController
 * JD-Core Version:    0.6.1
 */